//
//  YTSignGiftView.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/8/8.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTSignGiftView.h"
#import "YTLabel.h"
@interface YTSignGiftView()
@property (weak, nonatomic) IBOutlet YTLabel *tipLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end
@implementation YTSignGiftView
- (IBAction)closeButtonClick:(UIButton *)sender {
    [self hideInController];

}



- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.imageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(getEtaiCoin)];
    
    [self.imageView addGestureRecognizer:tap];
}

- (void)getEtaiCoin
{
    
    [YTNetworkManager.shareManager requestSiginWithType:@"1" post_id:nil
                                             completion:^(BOOL isSucc, NSString *StatusInfo)
     {
         if (!isSucc) {
             [self showTipWithTipStr:StatusInfo];
             return ;
         }
         
         self.tipLabel.text = [NSString stringWithFormat:@"恭喜您获得%@ETAI",StatusInfo];
         self.imageView.image = [UIImage imageNamed:@"lihe_dakai"];
         self.imageView.userInteractionEnabled = NO;
         self.completionBlock();
     }];
}
@end
